# $LastChangedDate: 2010-05-25 21:26:05 -0400 (Tue, 25 May 2010) $
# LEGAL: COPYRIGHT (C) 2010 JIM E. BROOKS WWW.PALOMINO3D.ORG
# Find Linux joystick header file (library N/A).
# Output:
# LINUX_JOYSTICK_FOUND
# LINUX_JOYSTICK_INC_DIR
# Notes:
# - See module.txt.
# - FreeBSD has a port that emulates a Linux joystick.
#-------------------------------------------------------------------------------

INCLUDE( CMakeModules/inc_find.cmake )

# Find include directory.
FIND_PATH( LINUX_JOYSTICK_INC_DIR
    NAMES linux/joystick.h
    PATHS ${POSSIBLE_INC_DIRS}
)

# (library N/A)

# Found?
IF( LINUX_JOYSTICK_INC_DIR )
    SET( LINUX_JOYSTICK_FOUND "TRUE" )
    MESSAGE( STATUS "Found Linux joystick: ${LINUX_JOYSTICK_INC_DIR}/joystick.h" )
ELSE()
    IF( LINUX_JOYSTICK_FIND_REQUIRED )
        MESSAGE( FATAL_ERROR "Could not find Linux joystick" )
    ENDIF()
ENDIF()
